'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Namespace Shell

    <ComImport()> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    <Guid(IID.Shell.IBrowserService4)> _
    Public Interface IBrowserService4
        <PreserveSig()> Function CacheOLEServer(ByRef pole As OLE.IOleObject) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function CanNavigateNow() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function DisplayParseError(<MarshalAs(UnmanagedType.Error)> ByVal hres As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwszPath As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetBrowserByIndex(ByVal dwID As UInteger, <Out(), MarshalAs(UnmanagedType.IUnknown)> ByRef ppunk As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetBrowserIndex() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetFlags(<Out()> ByRef pdwFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetHistoryObject(<Out(), MarshalAs(UnmanagedType.Interface)> ByRef ppole As OLE.IOleObject, <Out(), MarshalAs(UnmanagedType.Interface)> ByRef pstm As OLE.IStream, <Out(), MarshalAs(UnmanagedType.Interface)> ByRef ppbc As COM.IBindCtx) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetNavigateState(<Out()> ByRef bnstate As BNState) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetOleObject(<Out(), MarshalAs(UnmanagedType.Interface)> ByRef ppobjv As OLE.IOleObject) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetPalette(<Out()> ByRef hpal As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetParentSite(<Out(), MarshalAs(UnmanagedType.Interface)> ByRef ppipsite As OLE.IOleInPlaceSite) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetPidl(<Out()> ByRef ppidl As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetSetCodePage(ByVal pvarIn As Object, <Out()> ByRef pvarOut As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetTitle(<MarshalAs(UnmanagedType.Interface)> ByVal psv As IShellView, <Out(), MarshalAs(UnmanagedType.LPWStr)> ByRef pszName As String, ByVal cchName As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetTravelLog(<Out(), MarshalAs(UnmanagedType.Interface)> ByRef pptl As ITravelLog) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function IEGetDisplayName(ByVal pidl As ItemIdList, <Out(), MarshalAs(UnmanagedType.LPWStr)> ByRef pwszName As String, ByVal uFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function IEParseDisplayName(ByVal uiCP As UInteger, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwszPath As String, <Out()> ByRef ppidlOut As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function IsControlWindowShown(ByVal id As UInteger, <Out(), MarshalAs(UnmanagedType.Bool)> ByRef pfShown As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function NavigateToPidl(ByVal pidl As ItemIdList, ByVal grfHLNF As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function NotifyRedirect(<MarshalAs(UnmanagedType.Interface)> ByVal psv As IShellView, ByVal pidl As ItemIdList, <Out(), MarshalAs(UnmanagedType.Bool)> ByRef pfDidBrowse As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnHttpEquiv(<MarshalAs(UnmanagedType.Interface)> ByVal psv As IShellView, <MarshalAs(UnmanagedType.Bool)> ByVal fDone As Boolean, ByVal pvarargIn As Object, <Out()> ByRef pvarargOut As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function RegisterWindow(<MarshalAs(UnmanagedType.Bool)> ByVal fForceRegister As Boolean, ByVal swc As Integer) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetFlags(ByVal dwFlags As UInteger, ByVal dwFlagMask As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetHistoryObject(<MarshalAs(UnmanagedType.Interface)> ByVal pole As OLE.IOleObject, <MarshalAs(UnmanagedType.Bool)> ByVal fIsLocalAnchor As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetNavigateState(ByVal bnstate As BNState) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetReferrer(ByVal pidl As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetTitle(<MarshalAs(UnmanagedType.Interface)> ByVal psv As IShellView, <MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function ShowControlWindow(ByVal id As UInteger, <MarshalAs(UnmanagedType.Bool)> ByVal fShow As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function UpdateBackForwardState() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function UpdateWindowList() As <MarshalAs(UnmanagedType.Error)> Integer

        <PreserveSig()> Function _CancelPendingNavigationAsync() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _CancelPendingView() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _CloseAndReleaseToolbars(<MarshalAs(UnmanagedType.Bool)> ByVal fClose As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _DisableModeless() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _ExecChildren(<MarshalAs(UnmanagedType.IUnknown)> ByVal punkBar As Object, <MarshalAs(UnmanagedType.Bool)> ByVal fBroadcast As Boolean, ByRef pguidCmdGroup As Guid, ByVal nCmdID As UInteger, ByVal nCmdexecopt As UInteger, ByVal pvarargIn As Object, ByVal pvarargOut As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _FindTBar(<MarshalAs(UnmanagedType.IUnknown)> ByVal punkSrc As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _get_itbLastFocus() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _GetBorderDWHelper(<MarshalAs(UnmanagedType.IUnknown)> ByVal punkSrc As Object, ByVal lprectBorder As Rect, <MarshalAs(UnmanagedType.Bool)> ByVal bUseHmonitor As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _GetEffectiveClientArea(ByRef lprectBorder As Rect, ByVal hmon As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _GetToolbarCount() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _GetToolbarItem(ByVal itb As Integer) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _GetViewBorderRect(ByRef prc As Rect) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _Initialize(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.IUnknown)> ByVal pauto As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _LoadToolbars(<MarshalAs(UnmanagedType.Interface)> ByVal pstm As OLE.IStream) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _MaySaveChanges() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _NavigateToPidl(ByVal pidl As ItemIdList, ByVal grfHLNF As UInteger, ByVal dwFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _OnFocusChange(ByVal itb As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _PauseOrResumeView(<MarshalAs(UnmanagedType.Bool)> ByVal fPaused As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _put_itbLastFocus(ByVal itbLastFocus As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _ResizeNextBorder(ByVal itb As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _ResizeNextBorderHelper(ByVal itb As UInteger, <MarshalAs(UnmanagedType.Bool)> ByVal bUseHmonitor As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _ResizeView() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _SaveToolbars(<MarshalAs(UnmanagedType.Interface)> ByVal pstm As OLE.IStream) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _SendChildren(ByVal hwndBar As IntPtr, <MarshalAs(UnmanagedType.Bool)> ByVal fBroadcast As Boolean, ByVal uMsg As UInteger, ByVal wParam As Object, ByVal lParam As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _SetFocus(ByVal ptbi As ToolbarItem, ByVal hwnd As IntPtr, ByVal lpMsg As Msg) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _SwitchActivationNow() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _TryShell2Rename(<MarshalAs(UnmanagedType.Interface)> ByVal psv As IShellView, ByVal pidlNew As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _UIActivateView(ByVal uState As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function _UpdateViewRectSize() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function ActivatePendingView() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function AllowViewResize(<MarshalAs(UnmanagedType.Bool)> ByVal f As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function CreateBrowserPropSheetExt(ByRef riid As Guid, <Out(), MarshalAs(UnmanagedType.Interface)> ByRef ppv As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function CreateViewWindow(<MarshalAs(UnmanagedType.Interface)> ByVal psvNew As IShellView, <MarshalAs(UnmanagedType.Interface)> ByVal psvOld As IShellView, <Out()> ByRef prcView As Rect, <Out()> ByRef phwnd As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function ForwardViewMsg(ByVal uMsg As Integer, ByVal wParam As Object, ByVal lParam As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetBaseBrowserData(ByRef pbbd As BaseBrowserData) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetFolderSetData(ByRef pfsd As FolderSetData) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetViewRect(ByRef prc As Rect) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetViewWindow(<Out()> ByRef phwndView As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function InitializeDownloadManager() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function InitializeTransitionSite() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function InitializeTravelLog(<MarshalAs(UnmanagedType.Interface)> ByVal ptl As ITravelLog, ByVal dw As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Offline(ByVal iCmd As Integer) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnCommand(ByVal wParam As Object, ByVal lParam As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnCreate(ByVal pcs As CreateStrcut) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnDestroy(<MarshalAs(UnmanagedType.Bool)> ByVal fActive As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnFrameWindowActivateBS(ByRef pcs As NMHDR) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnNotify(ByRef pcs As NMHDR) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnSetFocus() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OnSize(ByVal wParam As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function PutBaseBrowserData() As BaseBrowserData
        <PreserveSig()> Function ReleaseShellView() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetAcceleratorMenu(ByVal hacc As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetActivateState(ByVal u As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetAsDefFolderSettings() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetTopBrowser() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function UpdateSecureLockIcon(ByVal eSecureLock As Integer) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function v_CheckZoneCrossing(ByRef pidl As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function v_GetViewStream(ByVal pidl As ItemIdList, ByVal grfMode As UInteger, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwszName As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function v_MayGetNextToolbarFocus(ByVal lpMsg As Msg, ByVal itbNext As UInteger, ByVal citb As UInteger, <Out()> ByRef pptbi As UInteger, <Out()> ByRef phwnd As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function v_MayTranslateAccelerator(ByVal pmsg As Msg) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function v_ShowHideChildWindows(<MarshalAs(UnmanagedType.Bool)> ByVal fChildOnly As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function WndProcBS(ByVal hwnd As IntPtr, ByVal uMsg As UInteger, ByRef wParam As Object, ByRef lParam As Object) As <MarshalAs(UnmanagedType.Error)> Integer

        <PreserveSig()> Function _PositionViewWindow(ByVal hwnd As IntPtr, ByVal prc As Rect) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function IEParseDisplayNameEx(ByVal uiCP As UInteger, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwszPath As String, ByVal dwFlags As UInteger, <Out()> ByRef ppidlOut As ItemIdList) As <MarshalAs(UnmanagedType.Error)> Integer

        <PreserveSig()> Function _ResizeAllBorders() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function ActivateView(<MarshalAs(UnmanagedType.Bool)> ByVal fPendingView As Boolean) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SaveViewState() As <MarshalAs(UnmanagedType.Error)> Integer
    End Interface

End Namespace